package com.huike.business.service.impl;


import com.huike.business.domain.TbBusiness;
import com.huike.business.domain.TbBusinessTrackRecord;
import com.huike.business.mapper.TbBusinessMapper;
import com.huike.business.mapper.TbBusinessTrackRecordMapper;
import com.huike.business.service.ITbBusinessTrackRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商机跟进记录Service业务层处理
 * 
 * @author wgl
 * @date 2021-04-28
 */
@Service
public class TbBusinessTrackRecordServiceImpl implements ITbBusinessTrackRecordService {
    @Autowired//依赖注入商机跟进对象
    private TbBusinessTrackRecordMapper tbBusinessTrackRecordMapper;
    @Autowired//依赖注入商机对象
    private TbBusinessMapper tbBusinessMapper;
//新增商机跟进对象
    @Override
    public void insert(TbBusinessTrackRecord tbBusinessTrackRecord, TbBusiness tbBusiness) {
//        1.新增商机跟进对象
        tbBusinessTrackRecordMapper.insert(tbBusinessTrackRecord);
//        2.更新商机对象
        tbBusinessMapper.updateTbBusiness(tbBusiness);
    }
//查询商机跟进对象
    @Override
    public List<TbBusinessTrackRecord> findListByBusinessId(Long id) {
//        调用mapper层查询商机跟进对象
        return tbBusinessTrackRecordMapper.findList(id);
    }
}
